package com.example.teesystem.entity.vo.issue;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.example.teesystem.entity.Issue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @author pxr
 * @data 2022/3/31 10:42
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class IssueExcel extends BaseRowModel {
    @ExcelProperty(value = {"question"},index = 0)
    private String question;

    /**
     * 选项A
     */
    @ExcelProperty(value = {"selection_A"},index = 1)
    private String selectionA;

    /**
     * 选项B
     */
    @ExcelProperty(value = {"selection_B"},index = 2)
    private String selectionB;

    /**
     * 选项C
     */
    @ExcelProperty(value = {"selection_C"},index = 3)
    private String selectionC;

    /**
     * 选项D
     */
    @ExcelProperty(value = {"selection_D"},index = 4)
    private String selectionD;

    /**
     * 正确答案
     */
    @ExcelProperty(value = {"answer"},index = 5)
    private String answer;

    /**
     * 题目相关文件下载地址
     */
    @ExcelProperty(value = {"url"},index = 6)
    private String url;

    /**
     * 难度系数：由易到难1-5
     */
    @ExcelProperty(value = {"difficulty"},index = 7)
    private Integer difficulty;

    /**
     * 类型（0：训练题目，1：考试题目）
     */
    @ExcelProperty(value = {"training_exam"},index = 8)
    private Integer trainingExam;

    /**
     * 0：判断 1：填空 2：选择 3：简答
     */
    @ExcelProperty(value = {"type"},index = 9)
    private Integer type;

    /**
     * 题目解析
     */
    @ExcelProperty(value = {"analysis"},index = 10)
    private String analysis;

    @ExcelProperty(value = {"chapter_id"}, index = 11)
    private Integer chapterId;

    /**
     * 作为考试题目被引用次数
     */
    @ExcelProperty(value = {"reference_num"},index = 11)
    private Integer referenceNum;

    public IssueExcel(Issue issue){
        BeanUtils.copyProperties(issue,this);
    }

}
